package com.jiangfeixiang.markdown.controller;

import com.jiangfeixiang.markdown.entity.Content;
import com.jiangfeixiang.markdown.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author: 姜飞祥
 * @Description:
 * @Date: Create in 2019/1/29/0029 13:55
 * @param: $params$
 * @return: $returns$
 */
@Controller
public class ContentController {

    @Autowired
    private ContentService contentService;

    /**
     * 编辑页
     * @return
     */
    @RequestMapping("/edit")
    public String getText(){

        return "edit";
    }

    /**
     * 提交
     * @param content
     * @return
     */
    @RequestMapping("/addText")
    public String addText(Content content){
        contentService.addText(content);
        return "success";
    }
}
